<?
		include("dbconn.inc");
		include("dbfuc.inc");
		include("session.inc");		
		$user=$_SESSION["user"];
		$curid=$_SESSION["curid"];
		$dbconnection=$_SESSION["dbconnection"];		
	if(session_is_registered("dbconnection") )
	{
		if(($user!="") && (($curid!="") || ($curid!=0)))
		{

		$sql="";
		$ctuser="";$username="";
		$memberid=0;
		$ctuser=$_REQUEST["ctuser"];
		$first="";$last="";$name="";$address1="";$address2="";$address3="";$state="";$country="";
		$zipcode="";$contactno="";$mobileno="";$email="";$state1="";$districtname="";$district="";
		$sql="select pn_id,c_username from mlm_master where C_COUPON_USER='$ctuser' ";
		$result=mysql_query($sql);
		$rownum=mysql_num_rows($result);
		if($rownum >0)
		{
			$rownum=$rownum-1;
			$coupon_userid=mysql_result($result,$rownum,"pn_id");
			$usedcoupon_user=mysql_result($result,$rownum,"c_username");		
			
		}	
	
		$sql="select C_FNAME,C_ADDR1,C_ADDR2,C_ADDR3,C_STATE,C_ZIP_CODE,C_TELE_NO,C_EMAIL from mlm_address_dtl where n_id='$coupon_userid' ";
		$result=mysql_query($sql);
		$rownum=mysql_num_rows($result);
		if($rownum >0)
		{
			$rownum=$rownum-1;
			$name=mysql_result($result,$rownum,"C_FNAME");
			$address1=mysql_result($result,$rownum,"C_ADDR1");		
			$address2=mysql_result($result,$rownum,"C_ADDR2");
			$address3=mysql_result($result,$rownum,"C_ADDR3");	
			$state=mysql_result($result,$rownum,"C_STATE");	
			$zipcode=mysql_result($result,$rownum,"C_ZIP_CODE");
			$contactno=mysql_result($result,$rownum,"C_TELE_NO");	
			$email=mysql_result($result,$rownum,"C_EMAIL");	

	}

?> 
<HTML><HEAD><TITLE>Address_details</TITLE>
<META http-equiv=Content-Type content="text/html; charset=iso-8859-1">
<style type="text/css">
<!--
.styleR{
	font-family: Georgia, "Times New Roman", Times, serif;
	font-weight: bold;
}
.style1 {
	color: #FF0000;
	font-weight: bold;
}
-->
</style>
<style type="text/css">
<!--
.style4 {color: #000000}
.style5 {color: #FF0000}
-->
</style>
</HEAD>
<BODY bgColor=#FFFFFF>
<? include "allheader.php"  ?>	
<br>
<br>
<table width="58%" border="1" align="center" cellpadding="3" cellspacing="4" bordercolor="#006600" bgcolor="#FFFFFF">
  <tr bgcolor="#FFDDAA"> 
    <td colspan="4" bgcolor="#BDDF9C"><div align="left" class="style1"><font size="2" face="Verdana, Arial, Helvetica, sans-serif"><span class="style4">Details 
        of Coupon user&nbsp;</span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="style4">User 
    Name&nbsp;: </span><span class="style5"><? echo $usedcoupon_user ?></span></font></div></td>
  </tr>
  <tr> 
    <td width="27%" height="25"><div align="right"><font color="#000000" size="2"><SPAN 
                        style="COLOR: #800000; "><font color="#000033" face="Verdana, Arial, Helvetica, sans-serif">Name</font></SPAN></font><font color="#000000" size="2" face="Verdana, Arial, Helvetica, sans-serif"><SPAN 
                        style="COLOR: #800000; ">&nbsp;&nbsp;&nbsp;</SPAN></font></div></td>
    <td width="3%"><strong>:</strong></td>
    <td width="70%" colspan="2"><font color="#000000" size="2" face="Verdana, Arial, Helvetica, sans-serif"><? echo $name ?>&nbsp;</font></td>
  </tr>
  <tr> 
    <td><div align="right"><FONT color="#000000" size=2 
                        face="Verdana, Arial, Helvetica, sans-serif"><SPAN 
                        style="COLOR: #800000; "><font color="#000033">Address1</font>&nbsp;&nbsp;</SPAN></FONT></div></td>
    <td><strong>:</strong></td>
    <td colspan="2"><font color="#000000" size="2" face="Verdana, Arial, Helvetica, sans-serif"><? echo $address1 ?>&nbsp;</font></td>
  </tr>
  <tr> 
    <td><div align="right"><FONT color="#000000" size=2 
                        face="Verdana, Arial, Helvetica, sans-serif"><SPAN 
                        style="COLOR: #800000; "><SPAN 
                        style="COLOR: #800000; "><font color="#000033">Address2</font>&nbsp;&nbsp;</SPAN></SPAN></FONT></div></td>
    <td><strong>:</strong></td>
    <td colspan="2"><font color="#000000" size="2" face="Verdana, Arial, Helvetica, sans-serif"><? echo $address2 ?>&nbsp;</font></td>
  </tr>
  <tr > 
    <td><div align="right"><FONT color="#000000" size=2 
                        face="Verdana, Arial, Helvetica, sans-serif"><SPAN 
                        style="COLOR: #800000; "><SPAN 
                        style="COLOR: #800000; "><font color="#000033">Address3</font>&nbsp;&nbsp;</SPAN></SPAN></FONT></div></td>
    <td><strong>:</strong></td>
    <td colspan="2" ><font color="#000000" size="2" face="Verdana, Arial, Helvetica, sans-serif"><? echo $address3 ?></font></td>
  </tr>
  <tr> 
    <td><div align="right"><FONT color="#000000" size=2 
                        face="Verdana, Arial, Helvetica, sans-serif">State&nbsp;&nbsp;</FONT></div></td>
    <td><strong>:</strong></td>
    <td colspan="2"><font color="#000000" size="2" face="Verdana, Arial, Helvetica, sans-serif"><? echo $state ?></font></td>
  </tr>
  <tr> 
    <td><div align="right"><FONT color="#000000" size=2 
                        face="Verdana, Arial, Helvetica, sans-serif">Zip-Code&nbsp;&nbsp;</FONT></div></td>
    <td><strong>:</strong></td>
    <td colspan="2"><font color="#000000" size="2" face="Verdana, Arial, Helvetica, sans-serif"><? echo $zipcode ?></font></td>
  </tr>
  <tr> 
    <td><div align="right"><FONT color="#000000" size=2 
                        face="Verdana, Arial, Helvetica, sans-serif">Contact No&nbsp;&nbsp; 
        </FONT></div></td>
    <td><strong>:</strong></td>
    <td colspan="2"><font color="#000000" size="2" face="Verdana, Arial, Helvetica, sans-serif"><? echo $contactno ?></font></td>
  </tr>
  <tr> 
    <td><div align="right"><FONT color="#000000" size=2 
                        face="Verdana, Arial, Helvetica, sans-serif">Email&nbsp;&nbsp;</FONT></div></td>
    <td><strong>:</strong></td>
    <td colspan="2"><font color="#000000" size="2" face="Verdana, Arial, Helvetica, sans-serif"><? echo $email ?></font></td>
  </tr>
</table>
<br>
<table width="54%" border="0" align="center" cellspacing="0">
  <tr>
    <td><p align="center"><a href="javascript:history.back();" class="styleR"><font color="#6633CC">Back</font></a><br>
      </p>
    </td>
  </tr>
</table>
</BODY>
</HTML>
<?	
		}	
    }
	else
	{
		$errormsg="*Your session is expeired please login again";
		header("location: index.php?error=$errormsg");
	}
?>	

